package dse.messages;

import dse.ExperimentRecorder;

public interface MessageHandler {
	/**
	 * Lets the handler decide if it still wants the message.
	 * 
	 * @param message
	 * @return
	 */
	boolean acceptMessage (
			Message message
			);
	/**
	 * Called when the message has been fully transferred.
	 * 
	 * @param recorder
	 * @param message
	 * @param timeLeft
	 */
	void messageReceived (
			ExperimentRecorder recorder,
			Message message, 
			double time
			);
	/**
	 * Called when the message could not be delivored becasue one of the nodes
	 * (from or to or both) is down.
	 * 
	 * @param recorder
	 * @param message
	 * @param timeLeft
	 */
	void messageInterupted (
			ExperimentRecorder recorder,
			Message message, 
			double time
			);
			
}
